package com.ce.pms.custservice.dao.impl;

import java.util.List;

import com.ce.pms.base.dao.impl.PmsBaseDaoImpl;
import com.ce.pms.base.vo.SearchVO;
import com.ce.pms.custservice.dao.ITrackRecordDao;
import com.ce.pms.custservice.model.TrackRecordDO;
import com.sitechasia.webx.core.support.Page;
/**
 * 功能描述: 跟踪Dao功能实现类
 * <p>版权所有：中企动力
 * <p>未经本公司许可，不得以任何方式复制或使用本程序任何部分
 * @author  胡煦
 * Create on:2008-12-24
 * Edit author:
 * Edit on:
 * 修改原因：
 */

public class TrackRecordDaoImpl extends PmsBaseDaoImpl<TrackRecordDO> implements ITrackRecordDao{
	 /**
	  * 方法描述: 分页查询TrackRecordVO方法
	  * @author 胡煦
	  * Create on:2008-12-24
	  * @param csEventID,search
	  * @return Page
	  * @roseuid 49436CB301C5
	  */
   public Page queryTrackRecordByPage(Long csEventID,SearchVO search){
	   StringBuilder queryStr = new StringBuilder(" from TrackRecordDO tr where 1=1 and tr.customerServiceEventDO.id = ? order by ");
	   queryStr.append(" tr.recordTime desc ");
	   Page page = super.pagedQueryByPageNo(queryStr.toString(), search.getPageNo(), search.getPageSize(), new Object[]{csEventID});
	   return page;
   }
   /**
	  * 方法描述: 根据事件ID查询List<TrackRecordDO>方法
	  * @author 胡煦
	  * Create on:2008-12-24
	  * @param csEventID
	  * @return List<TrackRecordDO>
	  * @roseuid 49436CB301C5
	  */
 public List<TrackRecordDO> queryTrackRecordByCsEventID(Long csEventID){
	   String queryStr = " from TrackRecordDO tr where 1=1 and tr.customerServiceEventDO.id = ? ";
	   List<TrackRecordDO> list = super.createQuery(queryStr, csEventID).list();
	   return list;
 }
}
